<div class="row">
    <div class="col-xs-12">
        <div class="box box-primary">
            <div class="box-header">
                <h3 class="box-title">系统日志</h3>

                <div class="box-tools">
                    <form class="form-horizontal">
                    <div class="input-group input-group-sm" style="width: 300px;">
                      @if(isset($mark))
                        <input id="sinput" type="text" name="table_search" class="form-control pull-right" placeholder="请输入用户名搜索" value="{{$mark}}">
                      @else
                        <input id="sinput" type="text" name="table_search" class="form-control pull-right" placeholder="请输入用户名搜索">
                        @endif
                        <div class="input-group-btn">
                            <button type="button" id="searchb-4" class="btn btn-primary" data-url="{{ url('admin/logs') }}" data-type="get" style="margin-right: 10px" onclick="getfun(this)"><i class="fa fa-search"></i></button>
                        </div>
                    </div>
                    </form>
                </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body table-responsive no-padding">
                <table class="table table-hover">
                    <tr>
                        <th>ID</th>
                        <th>用户名</th>
                        <th>姓名</th>
                        <th>操作</th>
                        <th>登录IP</th>
                        <th></th>
                        <th>时间</th>
                    </tr>
                    @foreach($logs as $log)
                    <tr>
                        <td>{{ $log->log_id }}</td>
                        <td>{{ $log->username }}</td>
                        <td>{{ $log->name }}</td>
                        <td>{{ $log->log_info }}</td>
                        <td>{{ $log->log_ip }}</td>
                        <td>{{ $log->log_url }}</td>
                        <td>{{ $log->log_time }}</td>
                    </tr>
                    @endforeach
                    @if(!$logs->count())
                    <tr>
                      <td colspan="8" style="text-align:center;">暂无数据</td>
                    </tr>
                    @endif
                </table>
            </div>
            <div class="box-footer clearfix">
                <ul class="pagination pagination-sm no-margin pull-right">
                    {{ $logs->links('vendor.pagination.pages') }}
                </ul>
            </div>
            <!-- /.box-body -->
        </div>
        <!-- /.box -->
    </div>
</div>
<script type="text/javascript">
$(function(){
      $("#sinput").keydown(function(event){
          if(event.keyCode==13){
            // 阻止页面刷新
              event.preventDefault();
            //回车键提交搜索内容
              $("#searchb-3").click();
          }
      });
})
</script>
